﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddAttributeType.aspx.cs"
    Inherits="Com.CMS263.Web.manage.ManageAttrType.AddAttributeType" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="/manage/css/common.css" rel="stylesheet" type="text/css" />
    <link href="/manage/css/main.css" rel="stylesheet" type="text/css" />
    <link href="/manage/css/box.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript" src="/manage/js/jquery-1.4.2.min.js"></script>

    <script type="text/javascript" language="javascript" src="/manage/js/pager.js"></script>

    <script type="text/javascript" language="javascript">
        function changeOutType() {
            var va = $("#selOutType").val();

            if (va == "0") {
                $("#spanTip").html("文本框输入链接地址");
                $("#txtOutApp").val("");
                $("#txtOutApp").show();
            }
            else if (va == "-1") {
                $("#spanTip").html("文本框输入分类menu");
                $("#txtOutApp").val("");
                $("#txtOutApp").show();
            }
            else {
                $("#spanTip").html("");
                $("#txtOutApp").val("");
                $("#txtOutApp").hide();
            }
        }
        
        function check() {
            var name = $("#txtTypeName").val();
            if (name.length < 1) {
                alert("请输入分类名称");
                return false;
            }
            var va = $("#selOutType").val();
            if (va == "0") {

                var strval = $("#txtOutApp").val();
                if (strval.length < 1) {
                    alert("选择其他请手动输入");
                    return false;
                }
            }
            

        }
    </script>

</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
    <div class="main">
        <div class="mainMenu">
            <div class="mainMenuList">
                <ul>
                    <li class="s"><a><b>添加文章类内容分类</b><span></span></a></li>
                </ul>
            </div>
        </div>
        <div class="mainContent">
            <div class="productList">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table2">
                    <tr>
                        <td class="c">
                            分类名称：
                        </td>
                        <td class="c">
                        <input type="text" name="txtTypeName" id="txtTypeName" style=" width:174px" />
                            
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="c" width="100">
                            外部程序连接
                        </td>
                        <td class="c" width="500">
                            <select id="selOutType" name="selOutType" onchange="changeOutType()">
                                <option value="0">其他</option>
                                <option value="-1">类别管理</option>
                                <option value="ManageBaseArt/BaseArtList.aspx">多条（排序 升序）</option>
                                <option value="ManageBaseArtDesc/BaseArtList.aspx">多条（排序 降序）</option>
                               
                                <option value="ManageSingleArt/AddBaseArt.aspx">单条</option>
                            </select>
                            <input type="text" id="txtOutApp" name="txtOutApp" style="width: 182px;" />
                        </td>
                        <td>
                            <span style=" color:Red" id="spanTip">文本框输入链接地址</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" class="c">
                            <asp:Button ID="Button1" runat="server" Text="添加分类" OnClientClick="return check()"
                                OnClick="Button1_Click" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="mainMenu">
            <div class="mainMenuList">
                <ul>
                    <li class="s"><a><b>扩展分类列表</b><span></span></a></li>
                </ul>
            </div>
        </div>
        <div class="mainContent">
            <div class="productList">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table2">
                    <tr>
                        <th width="40" class="c">
                            编号
                        </th>
                        <th class="c">
                            分类名称
                        </th>
                        <th class="c">
                            分类链接
                        </th>
                        <th class="c" width="160px">
                            操作
                        </th>
                    </tr>
                    <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand">
                        <ItemTemplate>
                            <tr>
                                <td class="c">
                                    <%#Eval("id") %>
                                </td>
                                <td class="c">
                                    <%#Eval("typeName") %>
                                </td>
                                <td class="c">
                                    <%#Eval("outApp") %>
                                </td>
                                <td class="c">
                                    <asp:LinkButton runat="server" ID="del" Text="删除" CommandArgument='<%#Eval("id") %>'
                                        OnClientClick="return confirm('真的要删除这个分类')" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;<a href="modAttrType.aspx?id=<%#Eval("id") %>">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;<a
                                        href="../ManageArtType/AddExtAttribute.aspx?id=<%#Eval("id") %>">添加扩展属性</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
